<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style>
			body {
				width: calc(100% - 10px);
				height: calc(100vh - 30px);
				margin: 0px;
				padding: 0px;
                background: transparent;
                background-color: transparent;
			}
            .iframeDiv {
                width: 100%;
                height: 100%;

                scrollbar-width: none;
                -ms-overflow-style: none;
            }

            .iframeDiv::-webkit-scrollbar {
                width: 100%;
                height: 100%;
                scrollbar-width: none;
                -ms-overflow-style: none;
            }
		</style>
	</head>
	<body>
		<iframe class="iframeDiv" id="iframe" allowfullscreen frameborder="0"
			allow="microphone;camera;midi;encrypted-media;"></iframe>
	</body>
	<script>
		//user_name="CSDL";
		let user_name = "bruce";
		let pwd = "Admin!@#16891";
		let url = "https://111.120.11.161:10006/api/index.php?ctl=tool&act=get_pkey";
		let iframeUrl;
		console.log(url);
		var httpRequest = new XMLHttpRequest();
		httpRequest.open('POST', url, false);
		httpRequest.send(JSON.stringify({"user_name":user_name,"pwd":pwd}));
		console.log(httpRequest.responseText);
		if (httpRequest.readyState == 4 && httpRequest.status == 200) {
			var json = JSON.parse(httpRequest.responseText);
			pkey = json.data;
			var getTokenUrl = "https://111.120.11.161:10006/api/index.php?ctl=tool&act=get_token";
			console.log(getTokenUrl);
			httpRequest.open('POST', getTokenUrl, false);
			httpRequest.send(JSON.stringify({"user_name":user_name,"pkey":pkey}));
			var json2 = JSON.parse(httpRequest.responseText);
			iframeUrl = "https://111.120.11.161:10006/login#token=" + json2.session_id + "&user_name=" + user_name + "&target=home";
			console.log(iframeUrl);
			document.getElementById("iframe").src = iframeUrl;
		} else {

		}
	</script>
</html>
